home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / 422mods.zip / MATRIX.422 < prev    next >
Text File  |  1993-02-28  |  10KB  |  352 lines

  1. GANON04.MOD
  2. Ganon #246 @18863  Van Nuys, Ca
  3. Fri, Feb 26, 1993 at 12:20:25 am
  4. Author      │ Ganon
  5. Date        │ 02/16/93
  6. Description │ Add A Matrix Menu In WWiV V4.22 (It Will Work On 4.21 Too)
  7. Difficulty  │ ▓░░░░░░░░░░░░░░░░░░░░░░░
  8. ──────────────────────────────────────────────────────────────────────────────
  9.  
  10.  
  11.            ALWAYS BACK UP YOUR SOURCE!!!!!!!!!!!!!!!!!!! 
  12.            ═════════════════════════════════════════════
  13.     
  14.     
  15.     Very Easy.. All You Have To Do Is Block Copy.  Step One Is To Open Up The
  16. LILO.C File. Search For 'void getuser()' And Replace It By Block Coping What 
  17. You See Below. 
  18.  
  19.  
  20.  
  21. void getuser()    /* Starting Block Copying From Here Till I Say Stop */
  22. {
  23.   char s[81],s1[81],s2[81],s3[81],s4[5],*ss,sx1[21];
  24.   int i,ok,count,net_only,ch,ans,un,done;
  25.   long l;
  26.  
  27.   FILE *f;
  28.   thisuser.sysstatus &= (~sysstatus_ansi);
  29.   net_only=1;
  30.   if (syscfg.netlowtime!= syscfg.nethightime) {
  31.    if (syscfg.nethightime>syscfg.netlowtime) {
  32.     if ((timer()<=(syscfg.netlowtime*60.0)) || (timer()>=(syscfg.nethightime*60.0)))         net_only=0;
  33.     } else {
  34.       if ((timer()<=(syscfg.netlowtime*60.0)) && (timer()>=(syscfg.nethightime*60.0)))         net_only=0;
  35.     }
  36.   } else
  37.     net_only=0;
  38.   count=0;
  39.   ok=0;
  40.   checkit=1;
  41.   okmacro=0;
  42.   actsl=syscfg.newusersl;
  43.  
  44.     /* This next part is where the ansi checking is.  I put it    */
  45.     /* here so we can use color in the matrix.  Then it also      */
  46.     /* passes the CONNECT 9600 stuff also. This looks really nice */
  47.     /* with BBS's runing high speed modems. It works fine for non-*/
  48.     /* high speed boards as well though.                          */
  49.  
  50.   if ((!net_only)) {
  51.       ans=check_ansi();
  52.       if (ans>0) {
  53.     thisuser.sysstatus |= sysstatus_ansi;   /* this forces ansi if it */
  54.     thisuser.sysstatus |= sysstatus_color;  /* is detected */
  55.  
  56.     }
  57.  
  58.    printfile("CONNECT");   /* this is the first screen they see along*/
  59.     pausescr();            /* with the CONNECT info above.           */
  60.                /* I simply made it a connect.msg and used*/
  61.                /* Qedit and used WWIV colors.  You can */
  62.                /* use wwivedit too. I'll send mine so you*/
  63.                /* use it but edit it to say what you want*/
  64.                /* Do not allow this screen to clear the  */
  65.                /* screen though or you defeat the purpose*/
  66.    done=1;
  67.     do {
  68.      outchr(12);
  69.       printfile("MATRIX");   /* prints the matrix.ans/msg file */
  70.                  /* having the following commands */
  71.                  /* 1 Log on BBS                   */
  72.                  /* 2 Newuser                      */
  73.                  /* 3 Hang up...                   */
  74.                  /* 4 Leave Feedback               */
  75.                  /* 5 Check access                 */
  76.  
  77.       nl();
  78.   npr("                              %s\r\n",times());
  79.   ansic(0);
  80.   outstr("                          Command : ");
  81.     ch=onek("41253N");
  82.     switch(ch) {
  83.       case '5':  /* Check for access function */
  84.       usernum=0;
  85.       ok=0;
  86.       nl();
  87.       outstr("                                NN: ");
  88.       mpl(30);
  89.       input (s1,64);
  90.       usernum=finduser(s1);
  91.     if (usernum>0) {
  92.       read_user(usernum,&thisuser);
  93.       actsl = syscfg.newusersl;
  94.       ok=1;
  95.       prt(1,"                          Password: ");
  96.       mpl(8);   echo=0;
  97.       input(s,8);
  98.     if (strcmp(s,thisuser.pw)!=0)
  99.       ok=0;
  100.  
  101.     if (ok) {
  102.       nl();
  103.  
  104.       /* My newuser sl is 10.  If a user gets validated, they have a */
  105.       /* sl of 30.  This checks to see that sl is HIGHER than 20. If */
  106.       /* so, then they are validated and it says so. change sl if you*/
  107.       /* need to */
  108.  
  109.      if (thisuser.sl>=20) {
  110.        nl();
  111.        pl("You Have Been Validated.");
  112.        nl();
  113.        pl("Please Select '1' From The Menu And Logon Normal.");
  114.        nl();
  115.      } else {
  116.        nl();
  117.        pl("Sorry, You Have Not Been Validated Yet.  Call Back Later");
  118.        nl();
  119.        }
  120.     } else {
  121.       ++thisuser.illegal;
  122.       write_user(usernum,&thisuser);
  123.       close_user();
  124.       nl();
  125.       pl("\7Illegal Access Check. (wrong password)\7");
  126.       nl();
  127.       sysoplog("User Tried Checking Access. Wrong Password");
  128.       usernum=0;
  129.       }
  130.        }
  131.       pausescr();
  132.         break;
  133.     case '4':  /* leave feedback from matrix */
  134.         nl();
  135.       prt(0,"Your Name: ");
  136.       input (s,30);
  137.       strcpy(thisuser.name,s);
  138.       usernum=0;
  139.       strcpy(irt,"Matrix Feedback");
  140.       irt_name[0]=0;
  141.         nl();
  142.       email(1,0,1,0);
  143.         break;
  144.  
  145.     case '2':
  146.     printfile("newuser1.msg");
  147.        prt(7,"Did You Read, And Do You Understand And Agree To These Terms?");
  148.       if (ny())
  149.  
  150.     newuser();
  151.  
  152.  
  153.     ok=1;
  154.     break;
  155.  
  156.     case '3': done=0; hangup=1;  break;  /* hangup */
  157.  
  158.   /* Uncomment whichever one you want. If you want system password */
  159.   /* then uncomment that line, otherwise uncomment the other line */
  160.  
  161.     case '1': done=0; break;
  162.    /*case '1': done=0; systempassword(); break; */      /* password */
  163.  
  164.     case 'N': done=0; break;  /* for network */
  165.       }
  166.     } while ((done==1) && (!hangup));
  167.  
  168.     do {
  169.     if (net_only) {
  170.       pl("This time is reserved for net-mail ONLY.");
  171.       pl("Please try calling back again later.");
  172.      } else
  173.  
  174.       /* The NN:\b\b\b is for allowing the network to see a nn: */
  175.       /* prompt.  A user will NEVER see it, but the net will    */
  176.       /* The network sends the normal n n n n which is aborts   */
  177.       /* the msg screens and pauses, and then at the matrix it  */
  178.       /* passes a n and it goes to the prompt as if it hit 1 to */
  179.       /* log on.  Then its sees the NN: and bingo.. no macros   */
  180.       /* are needed at all. */
  181.  
  182.       outstr("NN:\b\b\b                                NN: ");
  183.       mpl(30);
  184.       input(s,30);
  185.       usernum=finduser(s);
  186.        if ((net_only) && (usernum!=-2))
  187.       usernum=0;
  188.        if (usernum>0) {
  189.       read_user(usernum,&thisuser);
  190.       actsl = syscfg.newusersl;
  191.       topscreen();  ok=1;
  192.       prt(0,"                          Password: ");
  193.       mpl(8);   echo=0;
  194.       input(s,8);
  195.        if (strcmp(s,thisuser.pw)!=0)
  196.       ok=0;
  197.        if ((syscfg.sysconfig & sysconfig_free_phone)==0) {
  198.       prt(0,"           Finish Phone # : ###-###-");
  199.       mpl(4);   echo=0;
  200.       input(s2,4);
  201.       strcpy(s4,s2);
  202.        if (strcmp(s2,&thisuser.phone[8])!=0) {
  203.       ok=0;
  204.        if ((strlen(s2)==4) && (s2[3]=='-')) {
  205.       nl();
  206.       pl("!! Enter the LAST 4 DIGITS of your phone number ONLY !!");
  207.         nl();
  208.       }
  209.     }
  210.       }
  211.       if ((thisuser.sl==255) && (incom) && (ok)) {
  212.     outstr("SY: ");
  213.     echo=0;
  214.     input(s,20);
  215.     if (strcmp(s,syscfg.systempw)!=0)
  216.       ok=0;
  217.       }
  218.       echo=1;
  219.       if (ok) {
  220.     reset_act_sl();
  221.     changedsl();
  222.       } else {
  223.     ++thisuser.illegal;
  224.     write_user(usernum,&thisuser);
  225.     close_user();
  226.     nl();
  227.     pl("\7ILLEGAL LOGON\7");
  228.     nl();
  229.     sprintf(s3,"### ILLEGAL LOGON for %s (%s) (PW=%s)",
  230.         nam(&thisuser,usernum),
  231.         ctim(timer()),
  232.         s);
  233.     sl1(0,s3);
  234.     usernum=0;
  235.       }
  236.     } else
  237.       if (usernum==-1) {
  238.     printfile("LEGAL.MSG");
  239.       nl();
  240.       prt(0,"Did You Read, And Do You Understand And Agree To These Terms?");
  241.       if (ny())
  242.     {
  243.     newuser();
  244.     ok=1;
  245.     }
  246.     {
  247.     hangup=1;
  248.     }
  249.       } else
  250.     if (usernum==0) {
  251.       if (net_only)
  252.         nl();
  253.       else
  254.         pl("Unknown User.");
  255.     } else
  256.       if ((usernum==-2) || (usernum==-3) || (usernum==-4)) {
  257.         if (incom) {
  258.           save_status();
  259.           time(&l);
  260.           s2[0]=0;
  261.           switch(usernum) {
  262.         case -2:
  263.           sprintf(s2,"NETWORK /B%u /T%ld /F%u",modem_speed,l,modem_flag);
  264.           run_external1(s2);
  265.           break;
  266.         case -3:
  267.           sprintf(s2,"REMOTE /B%u /F%u",modem_speed,modem_flag);
  268.           run_external1(s2);
  269.           break;
  270.         case -4:
  271.           s[8]=0;
  272.           if (s[0]) {
  273.             sprintf(s2,"%s /B%u /F%u",s,modem_speed,modem_flag);
  274.             sprintf(s3,"%sREMOTES.DAT",syscfg.datadir);
  275.             f=fopen(s3,"rt");
  276.             if (f) {
  277.               ok=0;
  278.               while ((!ok) && (fgets(s3,80,f))) {
  279.             ss=strchr(s3,'\n');
  280.             if (ss)
  281.               *ss=0;
  282.             if (stricmp(s3,s)==0)
  283.               ok=1;
  284.               }
  285.               fclose(f);
  286.               if (ok) {
  287.             shrink_out(s2, -1, 0, 0, 1);
  288.             run_external1(s2);
  289.               }
  290.             }
  291.           }
  292.           break;
  293.           }
  294.           l=status.qscanptr;
  295.           get_status();
  296.           if (l!=status.qscanptr) {
  297.         for (i=0; i<num_subs; i++) {
  298.           sub_dates[i]=0L;
  299.         }
  300.           }
  301.           hangup=1;
  302.           dtr(0);
  303.           global_xx=0;
  304.           wait(1.0);
  305.           dtr(1);
  306.           wait(0.1);
  307.           cleanup_net();
  308.           imodem(0);
  309.         }
  310.         hangup=1;
  311.       }
  312.  
  313.   } while ((!hangup) && (!ok) && (++count<3));
  314.   if (count==3)
  315.     hangup=1;
  316.   checkit=0;
  317.   okmacro=1;
  318.   if ((!hangup) && (usernum>0) && (thisuser.restrict & restrict_logon) &&
  319.     (strcmp(date(),thisuser.laston)==0) && (thisuser.ontoday>0)) {
  320.     nl();
  321.     pl("Sorry, You Can Only Logon Once Per Day.");
  322.     nl();
  323.     hangup=1;
  324.     }
  325.   }
  326. }       /* STOP */
  327.  
  328.  
  329.     Thats It. Now Go Into Your Ansi Draw, And Make A Pre-Logon Menu, Which 
  330. Should Have The Options Below That You See
  331.  
  332.     [1]  Log On To BBS
  333.     [2]  Apply For Access
  334.     [3]  Hang Up
  335.     [4]  Send Feedback To SysOp
  336.     [5]  Check For Access
  337.  
  338. Make However You Like It And Whatever Colors You Want And Name The File As
  339. MATRIX.ANS And Drop It In Your G-File Section.  After That You Should Make
  340. Two Newuser Messages By Naming One NEWUSER1.MSG And NEWUSER.MSG And Again
  341. Putted In Your G-File Directory. NOTE: You Can Put Whatever You Like In The 
  342. Newuser MSG Files, Something That You Would Like Your New Users To Know.
  343.     
  344.              Thats It. Enjoy!
  345.       
  346.     If You Encounter Any Problems With This Mod, Contact Me.
  347.  
  348.  
  349.                ──══ DARK WORLD BBS ══──
  350.                 (8i8)Not-Even
  351.                 SysOp - Ganon
  352.